package net.sf.microlog.android.example;

import net.sf.microlog.android.appender.FileAppender;
import net.sf.microlog.core.Level;
import net.sf.microlog.core.Logger;
import net.sf.microlog.core.LoggerFactory;
import net.sf.microlog.core.appender.ConsoleAppender;
import android.app.Activity;
import android.os.Bundle;




public class Microlog4Android extends Activity {
	
	private final static Logger log = LoggerFactory.getLogger(Microlog4Android.class);
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        FileAppender appender = new FileAppender();
        appender.setContext(this);
        log.addAppender(appender);
        log.addAppender(new ConsoleAppender());
        log.setLogLevel(Level.DEBUG);
        log.error("Testing to log error message with Microlog.");
        
        setContentView(R.layout.main);
    }
}